package com.boonya.lab.controller;

import com.boonya.lab.rpc.client.GrpcClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GprcController {

    @Autowired
    private GrpcClientService grpcClientService;

    @RequestMapping("/test")
    public String printMessage(@RequestParam(defaultValue = "Michael") final String name) {
        return this.grpcClientService.sendMessage(name);
    }

}
